finding remainder by using long division method